POV-Ray : Newsgroups : povray.binaries.images : First preview of tesselation patch : First preview of tesselation patch Server Time
19 Aug 2024 08:16:21 EDT (-0400)
  First preview of tesselation patch  
From: Warp
Date: 13 Dec 2000 09:40:51
Message: <3a378a72@news.povray.org>
I have been working on a tesselation patch for POV-Ray. My intention is also
to make a mesh data extraction patch (else the tesselation patch would be
pretty useless).
  You can tesselate any object with a finite bounding box with it. The
syntax is:

tesselate(Object, Accuracy, Smooth, BBox_Offset)

with the last two parameters being optional.

  The first parameter is the object to be tesselated (must have a finite
bounding box).
  The second object is an accuracy value. Must be a positive integer value.
  The third parameter is a boolean value which tells the function whether
to calculate flat or smooth triangles.
  I'll explain the fourth parameter when the patch is more ready.

  The function returns a regular mesh object which can be used anywhere a
mesh object can be used.
  With the other patch you will also be able to extract the data
(vertices, triangles, normals...) from the mesh (from any mesh, not just
the ones created with the tesselation function).

  This is an example of the very first working version of the patch (that
is, it doesn't crash ;) ).
  Code and image:

#default { pigment { rgb <1,1,0> } finish { specular .5 } }

#declare Obj =
  union
  { sphere { y,.5 }
    cylinder { y,-y*.5,.25 }
    sphere { -y*.5,.25 }
    cylinder { y*.5, -x*.6, .2 }
    sphere { -x*.6, .2 }
    cylinder { y*.5, x*.6, .2 }
    sphere { x*.6, .2 }
    cylinder { -y*.5, -x*.4-y, .2 }
    sphere { -x*.4-y, .2 }
    cylinder { -y*.5, x*.4-y, .2 }
    sphere { x*.4-y, .2 }
  }

object { Obj translate -x*3 }
object { tesselate(Obj, 10) translate -x+y*1.5}
object { tesselate(Obj, 10, yes) translate -x-y*1.5}
object { tesselate(Obj, 20) translate x+y*1.5}
object { tesselate(Obj, 20, yes) translate x-y*1.5}
object { tesselate(Obj, 30) translate x*3+y*1.5}
object { tesselate(Obj, 30, yes) translate x*3-y*1.5}

camera { location <0,2,-13> look_at 0 angle 35 }
light_source { <200,100,-150>, 1 }
light_source { <-200,100,-100>, x*.5 }


Post a reply to this message


Attachments:
Download 'tesselationtest1.jpg' (85 KB)

Preview of image 'tesselationtest1.jpg'
tesselationtest1.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.